package com.wanjia.estate.constant.tex;

import lombok.AllArgsConstructor;

import java.util.Objects;
import java.util.stream.Stream;

@AllArgsConstructor
public enum QlxzType {

    QLXZ100("100","国有土地"),
    QLXZ101("101","划拨"),
    QLXZ102("102","出让"),
    QLXZ103("103","作价出资（入股）"),
    QLXZ104("104","国有土地租赁"),
    QLXZ105("105","授权经营"),
    QLXZ106("106","家庭承包"),
    QLXZ107("107","其它方式承包"),
    QLXZ200("200","集体土地"),
    QLXZ201("201","家庭承包"),
    QLXZ202("202","其它方式承包"),
    QLXZ203("203","批准拨用"),
    QLXZ204("204","入股"),
    QLXZ205("205","联营");

    private final String code;
    private final String name;
    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static QlxzType get(String code) {
        return Stream.of(values())
                .filter(d -> Objects.equals(code, d.code))
                .findFirst()
                .orElse(null);
    }
}
